package com.itheima.mall.controller.omsController;

import com.itheima.mall.commons.R;
import com.itheima.mall.service.omsService.OssService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController

@RequestMapping("/aliyun")
public class ossController {

    @Autowired
    private OssService ossService;

    /**
     * 图片上传
     *
     * @return
     */
    @PostMapping("/oss/upload")
    public R photoUpload(MultipartFile photoFile) {
        String url = ossService.photoUpload(photoFile);
        return R.ok(url);
    }

}